import React, {Component} from 'react';

class Two extends Component {
    state = {
        isLoading:true,
        info:[]
    }
    render() {
        return (
            <div>
                {
                    this.state.isLoading?<div>正在加载中……</div>:this.state.info.map(item=>(
                        <h3 key={item}>{item}</h3>
                    ))
                }
            </div>
        );
    }
    componentDidMount() {
        setTimeout(()=>{
            this.setState({
                info:[1,2,3,4],
                isLoading:false
            })
        },2000)
    }
}

export default Two;